/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Calculadora;

/**
 *
 * @author Jorge
 */
public class Potencia extends OperacionBinaria {

  public Potencia(Operacion op1, Operacion op2) {
      super(op1, op2);
  }

  public Number Potencia() {
  return Math.pow(op1.Operar().doubleValue(), op2.Operar().doubleValue());
  }

  @Override
  public Number Operar() {
  return Potencia();
  }
  
  @Override
  public String toString(){
      return op1.toString() + " ^(" + op2.toString() + ") ";
  }

}